Operations
The following are examples of AppleScript operations and their values. The value of each operation is listed following the comment characters (--
).
3 + 4 --value: 7 (12 > 4) AND (12 = 4) --value: falseEach operation contains an operator. The plus sign (+
) in the first expression, as well as the greater than symbol (>
), the equal symbol (=
) symbol, and the wordAND
in the second expression, are operators. Operators transform values or pairs of values into other values. Operators that operate on two values are called binary operators. Operators that operate on a single value are known as unary operators. Chapter 6, "Expressions," contains a complete list of the operators AppleScript supports and the rules for using them.You can use operations within AppleScript statements, such as:
tell application "Scriptable Text Editor" delete word 3 + 4 of document "Test"end tellWhen you run this script, AppleScript evaluates the expression3 + 4
and uses the result to determine which word to delete.